package com.spring.lesson001.demo5;

import java.beans.ConstructorProperties;

/**
 * @author vhans
 */
public class Car {
    private String name;
    private String desc;

    public Car(){
    }

    // 通过注解ConstructorProperties指定相应的参数名称，在编译后对应上
    @ConstructorProperties({"name", "desc"})
    public Car(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }

    @Override
    public String toString() {
        return "Car{" +
                "name='" + name + '\'' +
                ", desc='" + desc + '\'' +
                '}';
    }
}
